const request = require('../utils/request')

/**
 * 获取商品详情
 * @param  id  商品id
 * @returns 
 */
export const getGoodsInfo = id =>request.get('/api/goods/' + id)

/**
 * 收藏或者取消收藏商品
 * @returns {Promise<unknown>}
 */
export const  collect = id =>request.post('/api/collects/goods/' + id)

/**
 * 获取商品列表
 * @return {Promise<unknown>}
 */
export const getGoodsList = (data) =>request.get('/api/goods',data)